package cn.mesmile.message.model.email.entity;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.mail.MailAccount;
import cn.hutool.extra.mail.MailUtil;
import com.sun.mail.util.MailSSLSocketFactory;

import java.sql.Struct;

/**
 * @author zb
 * @date 2021/7/20 22:03
 * @Description
 */
public class EmailTest {

    public static void main(String[] args) {
        MailAccount account = new MailAccount();
        account.setHost("smtp.qq.com");
        account.setPort(465);
        account.setAuth(true);
        account.setSslEnable(true);
        account.setStarttlsEnable(true);
        account.setFrom("test科技<1043260947@qq.com>");
        account.setUser("1043260947");
        // ecxwyhettgnvbcge   uzoszijxrjnfbdjh
        account.setPass("ecxwyhettgnvbcge");

        String send = MailUtil.send(account, CollUtil.newArrayList("springzb@dingtalk.com"), "测试2", "邮件来自Hutool测试3", false);
        System.out.println("send = " + send);
    }
}
